<?php

namespace App\Http\Resources\Backend;

use Illuminate\Http\Resources\Json\Resource;

/**
 * Class SchoolRuleResource
 * @package App\Http\Resources\School
 */
class SchoolRuleResource extends Resource
{
    /**
     * @param \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'dinner_deadline' => $this->dinner_deadline,
            'dinner_end' => $this->dinner_end,
            'dinner_rule' => $this->dinner_rule,
            'dinner_start' => $this->dinner_start,
            'lunch_deadline' => $this->lunch_deadline,
            'lunch_end' => $this->lunch_end,
            'lunch_rule' => $this->lunch_rule,
            'lunch_start' => $this->lunch_start,
            'morning_deadline' => $this->morning_deadline,
            'morning_end' => $this->morning_end,
            'morning_rule' => $this->morning_rule,
            'morning_start' => $this->morning_start,
            'school_id' => $this->school_id,
            'is_limit' => $this->is_limit,
            'created_at' => $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null,
            'updated_at' => $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null
        ];
    }
}
